<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultrag.net.nz/thymeleaf/layout"
>
<head>
    <meta charset="UTF-8">
    <title>Thymeleaf in action</title>
</head>
<body>
<div th:replace="~{fragments/header::header}"></div>
<h3 th:text="${userModel.title}"></h3>
<div>
    <a th:href="@{/users/form}">创建用户</a>
</div>
<table border="1">
    <thead>
    <tr>
        <td>ID</td>
        <td>name</td>
        <td>age</td>
        <td>sex</td>
        <td>height</td>
        <td>memo</td>
        <td>操作</td>
    </tr>
    </thead>
    <tbody>
    <tr th:if="${userModel.userList.size()} eq 0">
        <td colspan="3">没有用户信息！</td>
    </tr>
    <tr th:each="user:${userModel.userList}" th:if="${user.isDeleted} eq 0">
        <td th:text="${user.id}"></td>
        <td >
            <a th:href="@{'/users/'+${user.id}}" th:text="${user.name}"></a>
        </td>
        <td th:text="${user.age}"></td>
        <td th:text="${user.sex}"></td>
        <td th:text="${user.height}"></td>
        <td th:text="${user.memo}"></td>
        <td >
            <a th:href="@{'users/delete/'+${user.id}}">删除</a>
            <a th:href="@{'users/modify/'+${user.id}}">修改</a>
        </td>
    </tr>
    </tbody>
</table>
<div th:replace="~{fragments/footer::footer}"></div>
</body>
</html>